package cn.lsc.service.impl;

import cn.lsc.domain.Person;
import cn.lsc.mapper.PersonMapper;
import cn.lsc.service.IPersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PersonServiceImpl implements IPersonService {
    @Autowired
    private  PersonMapper personMapper;

    @Override
    public void save(Person person) {
        personMapper.save(person);
    }

    @Override
    public void delete(Long id) {
        personMapper.delete(id);
    }

    @Override
    public void update(Person person) {
        personMapper.update(person);
    }

    @Override
    public Person loadById(Long id) {
        System.out.println(id);
        return personMapper.loadById(id);
    }

    @Override
    public List<Person> loadAll() {
        return personMapper.loadAll();
    }
}
